﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KeZhou.ViewModels
{
    internal partial class AccountViewModel : ObservableObject
    {
        private static AccountViewModel instance;

        public static AccountViewModel Instance
        {
            get
            {
                return instance ?? (instance = new AccountViewModel());
            }
        }

        private AccountViewModel()
        {
            planList = new List<Plan>()
            {
                new Plan("武汉市", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString()),
                new Plan("南京市", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString()),
                new Plan("北京市", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString()),
                new Plan("桂林市", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortDateString())
            };
        }

        public partial class Plan: ObservableObject
        {
            [ObservableProperty]
            private string cityName;
            [ObservableProperty]
            private string start;
            [ObservableProperty]
            private string end;

            public Plan(string cityName, string start, string end)
            {
                this.cityName = cityName;
                this.start = start;
                this.end = end;
            }
        }

        [ObservableProperty]
        private List<Plan> planList;


    }
}
